package com.example.springboot.config.amqp.rabbitmq.workconsumer;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * rabbitmq的work模式的
 *
 * @Author:ChenZhangKun
 * @Date: 2021/1/2 23:15
 */
@Component
public class WorkConsumer {
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receive_1(String message) {
        System.out.println("message1 " + message);
    }

    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receive_2(String message) {
        System.out.println("message2 " + message);
    }
}
